/**
 * Created by fkjslee on 2017/12/28.
 */

window.onload = autoRun();

 var url = "http://118.24.11.68:8080";
// var url = "http://172.24.8.233:8080";

function autoRun() {
    var patientID = document.getElementById("patientID");
    patientID.value = GetQueryString("patientID");
}

/**
 * @return {null}
 */
function GetQueryString(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if (r !== null)return unescape(r[2]);
    return null;
}

function givePrescription() {
    window.location.href = url + "/prescription/prescription.html" +
            "?patientID=" + GetQueryString("patientID") +
    "&account=" + GetQueryString("account");
}

function giveCheck() {
    window.location.href = url + "/checkList/checkList.html" +
        "?patientID=" + GetQueryString("patientID") +
        "&account=" + GetQueryString("account");
}

function giveCase() {
    window.location.href = url + "/checkList/checkList.html" +
        "?patientID=" + GetQueryString("patientID") +
        "&account=" + GetQueryString("account");
}
